package org.example.wikwok.pojo;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * video
 * @author 
 */
public class Video implements Serializable {
    private Integer id;

    private String title;

    private Integer uploaderid;

    private Timestamp uploadtime;

    private String videopath;

    private String description;

    private static final long serialVersionUID = 1L;

    public Video(String title, Integer uploaderid, Timestamp uploadtime, String videopath, String description) {
        this.title = title;
        this.uploaderid = uploaderid;
        this.uploadtime = uploadtime;
        this.videopath = videopath;
        this.description = description;
    }

    public Video(Integer id, String title, String description, Integer uploaderid, Timestamp uploadtime, String videopath) {
        this.id = id;
        this.title = title;
        this.uploaderid = uploaderid;
        this.uploadtime = uploadtime;
        this.videopath = videopath;
        this.description = description;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getUploaderid() {
        return uploaderid;
    }

    public void setUploaderid(Integer uploaderid) {
        this.uploaderid = uploaderid;
    }

    public Timestamp getUploadtime() {
        return uploadtime;
    }

    public void setUploadtime(Timestamp uploadtime) {
        this.uploadtime = uploadtime;
    }

    public String getVideopath() {
        return videopath;
    }

    public void setVideopath(String videopath) {
        this.videopath = videopath;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Video other = (Video) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getUploaderid() == null ? other.getUploaderid() == null : this.getUploaderid().equals(other.getUploaderid()))
            && (this.getUploadtime() == null ? other.getUploadtime() == null : this.getUploadtime().equals(other.getUploadtime()))
            && (this.getVideopath() == null ? other.getVideopath() == null : this.getVideopath().equals(other.getVideopath()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getUploaderid() == null) ? 0 : getUploaderid().hashCode());
        result = prime * result + ((getUploadtime() == null) ? 0 : getUploadtime().hashCode());
        result = prime * result + ((getVideopath() == null) ? 0 : getVideopath().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", uploaderid=").append(uploaderid);
        sb.append(", uploadtime=").append(uploadtime);
        sb.append(", videopath=").append(videopath);
        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}